home *** CD-ROM | disk | FTP | other *** search
/ Apple Developer Connection 1998 Fall: Game Toolkit / Disc.iso / SDKs / QuickTime Mac / PInterfaces / ConditionalMacros.p < prev    next >
Encoding:
Text File  |  1998-04-09  |  10.7 KB  |  302 lines  |  [TEXT/MPS ]

  1. {
  2.      File:        ConditionalMacros.p
  3.  
  4.      Contains:    Set up for compiler independent conditionals
  5.  
  6.      Version:    Technology:    Universal Interface Files 3.1
  7.                  Release:    QuickTime 3.0
  8.  
  9.      Copyright:    © 1993-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        Please include the the file and version information (from above) with
  12.                  the problem description.  Developers belonging to one of the Apple
  13.                  developer programs can submit bug reports to:
  14.  
  15.                      devsupport@apple.com
  16.  
  17. }
  18. {$IFC UNDEFINED UsingIncludes}
  19. {$SETC UsingIncludes := 0}
  20. {$ENDC}
  21.  
  22. {$IFC NOT UsingIncludes}
  23.  UNIT ConditionalMacros;
  24.  INTERFACE
  25. {$ENDC}
  26.  
  27. {$IFC UNDEFINED __CONDITIONALMACROS__}
  28. {$SETC __CONDITIONALMACROS__ := 1}
  29.  
  30. {$I+}
  31. {$SETC ConditionalMacrosIncludes := UsingIncludes}
  32. {$SETC UsingIncludes := 1}
  33.  
  34. {***************************************************************************************************
  35.     UNIVERSAL_INTERFACES_VERSION
  36.     
  37.         0x0310 => version 3.1
  38.         0x0301 => version 3.0.1
  39.         0x0300 => version 3.0
  40.         0x0210 => version 2.1
  41.         This conditional did not exist prior to version 2.1
  42. ***************************************************************************************************}
  43. {$SETC UNIVERSAL_INTERFACES_VERSION := $0310}
  44.  
  45. {***************************************************************************************************
  46.  
  47.     TARGET_CPU_≈    
  48.     These conditionals specify which microprocessor instruction set is being
  49.     generated.  At most one of these is true, the rest are false.
  50.  
  51.         TARGET_CPU_PPC            - Compiler is generating PowerPC instructions
  52.         TARGET_CPU_68K            - Compiler is generating 680x0 instructions
  53.         TARGET_CPU_X86            - Compiler is generating x86 instructions
  54.         TARGET_CPU_MIPS            - Compiler is generating MIPS instructions
  55.         TARGET_CPU_SPARC        - Compiler is generating Sparc instructions
  56.         TARGET_CPU_ALPHA        - Compiler is generating Dec Alpha instructions
  57.  
  58.  
  59.     TARGET_OS_≈    
  60.     These conditionals specify in which Operating System the generated code will
  61.     run. At most one of the these is true, the rest are false.
  62.  
  63.         TARGET_OS_MAC            - Generate code will run under Mac OS
  64.         TARGET_OS_WIN32            - Generate code will run under 32-bit Windows
  65.         TARGET_OS_UNIX            - Generate code will run under some unix 
  66.  
  67.  
  68.     TARGET_RT_≈    
  69.     These conditionals specify in which runtime the generated code will
  70.     run. This is needed when the OS and CPU support more than one runtime
  71.     (e.g. MacOS on 68K supports CFM68K and Classic 68k).
  72.  
  73.         TARGET_RT_LITTLE_ENDIAN    - Generated code uses little endian format for integers
  74.         TARGET_RT_BIG_ENDIAN    - Generated code uses big endian format for integers     
  75.         TARGET_RT_MAC_CFM        - TARGET_OS_MAC is true and CFM68K or PowerPC CFM being used    
  76.         TARGET_RT_MAC_68881        - TARGET_OS_MAC is true and 68881 floating point instructions used    
  77.  
  78.  
  79.     PRAGMA_≈
  80.     These conditionals specify whether the compiler supports particular #pragma's
  81.     
  82.         PRAGMA_IMPORT             - Compiler supports: #pragma import on/off/reset
  83.         PRAGMA_ONCE              - Compiler supports: #pragma once
  84.         PRAGMA_STRUCT_ALIGN      - Compiler supports: #pragma options align=mac68k/power/reset
  85.         PRAGMA_STRUCT_PACK        - Compiler supports: #pragma pack(n)
  86.         PRAGMA_STRUCT_PACKPUSH    - Compiler supports: #pragma pack(push, n)/pack(pop)
  87.         PRAGMA_ENUM_PACK         - Compiler supports: #pragma options(!pack_enums)
  88.         PRAGMA_ENUM_ALWAYSINT     - Compiler supports: #pragma enumsalwaysint on/off/reset
  89.         PRAGMA_ENUM_OPTIONS        - Compiler supports: #pragma options enum=int/small/reset
  90.  
  91.     FOUR_CHAR_CODE
  92.     This conditional does the proper byte swapping to assue that a four character code (e.g. 'TEXT')
  93.     is compiled down to the correct value on all compilers.
  94.  
  95.         FOUR_CHAR_CODE('abcd')    - Convert a four-char-code to the correct 32-bit value
  96.  
  97.     TYPE_≈
  98.     These conditionals specify whether the compiler supports particular types.
  99.  
  100.         TYPE_LONGLONG            - Compiler supports "long long" 64-bit integers
  101.         TYPE_BOOL                - Compiler supports "bool"
  102.         TYPE_EXTENDED            - Compiler supports "extended" 80/96 bit floating point
  103.  
  104. ***************************************************************************************************}
  105.  
  106. {$IFC NOT UNDEFINED MWERKS}
  107.     {
  108.         CodeWarrior Pascal compiler from Metrowerks, Inc.
  109.     }
  110.     {$IFC MAC68K}
  111.         {$SETC TARGET_CPU_PPC              := FALSE}
  112.         {$SETC TARGET_CPU_68K              := TRUE}
  113.         {$SETC TARGET_CPU_X86              := FALSE}
  114.         {$SETC TARGET_CPU_MIPS             := FALSE}
  115.         {$SETC TARGET_CPU_SPARC         := FALSE}
  116.         {$SETC TARGET_RT_MAC_CFM        := FALSE}
  117.         {$SETC TARGET_RT_MAC_68881        := OPTION(mc68881)}
  118.         {$SETC TARGET_OS_MAC            := TRUE}
  119.         {$SETC TARGET_OS_WIN32            := FALSE}
  120.         {$SETC TARGET_OS_UNIX            := FALSE}
  121.         {$SETC TARGET_RT_LITTLE_ENDIAN    := FALSE}
  122.         {$SETC TARGET_RT_BIG_ENDIAN        := TRUE}
  123.     {$ELSEC}
  124.         {$IFC POWERPC}
  125.             {$SETC TARGET_CPU_PPC              := TRUE}
  126.             {$SETC TARGET_CPU_68K              := FALSE}
  127.             {$SETC TARGET_CPU_X86              := FALSE}
  128.             {$SETC TARGET_CPU_MIPS             := FALSE}
  129.             {$SETC TARGET_CPU_SPARC         := FALSE}
  130.             {$SETC TARGET_RT_MAC_CFM        := TRUE}
  131.             {$SETC TARGET_RT_MAC_68881        := FALSE}
  132.             {$SETC TARGET_OS_MAC            := TRUE}
  133.             {$SETC TARGET_OS_WIN32            := FALSE}
  134.             {$SETC TARGET_OS_UNIX            := FALSE}
  135.             {$SETC TARGET_RT_LITTLE_ENDIAN    := FALSE}
  136.             {$SETC TARGET_RT_BIG_ENDIAN        := TRUE}
  137.         {$ELSEC}
  138.             {$IFC INTEL}
  139.                 {$SETC TARGET_CPU_PPC              := FALSE}
  140.                 {$SETC TARGET_CPU_68K              := FALSE}
  141.                 {$SETC TARGET_CPU_X86              := TRUE}
  142.                 {$SETC TARGET_CPU_MIPS             := FALSE}
  143.                 {$SETC TARGET_CPU_SPARC         := FALSE}
  144.                 {$SETC TARGET_RT_MAC_CFM        := FALSE}
  145.                 {$SETC TARGET_RT_MAC_68881        := FALSE}
  146.                 {$SETC TARGET_OS_MAC            := FALSE}
  147.                 {$SETC TARGET_OS_WIN32            := TRUE}
  148.                 {$SETC TARGET_OS_UNIX            := FALSE}
  149.                 {$SETC TARGET_RT_LITTLE_ENDIAN    := TRUE}
  150.                 {$SETC TARGET_RT_BIG_ENDIAN        := FALSE}
  151.             {$ELSEC}
  152.                 Error unknown compiler targer
  153.             {$ENDC}
  154.         {$ENDC}
  155.     {$ENDC}    
  156.     {$SETC TYPE_EXTENDED                := TRUE}
  157.     {$SETC TYPE_LONGLONG                := FALSE}
  158.     {$SETC TYPE_BOOL                    := FALSE}
  159.     {$IFC MWERKS >= $1800}
  160.         {$SETC TYPED_FUNCTION_POINTERS    := PROCTYPE}
  161.     {$ELSEC}
  162.         {$SETC TYPED_FUNCTION_POINTERS    := 0}
  163.     {$ENDC}
  164. {$ELSEC} 
  165.  
  166.  
  167. {$IFC NOT UNDEFINED THINK}
  168.     {
  169.         THINK Pascal compiler from Symantec, Inc.     << WARNING: Unsupported Compiler >>
  170.     }
  171.     {$SETC TARGET_CPU_68K                  := 1}
  172.     {$SETC TARGET_CPU_PPC                  := 0}
  173.     {$SETC TARGET_CPU_X86                  := 0}
  174.     {$SETC TARGET_CPU_MIPS                 := 0}
  175.     {$SETC TARGET_CPU_SPARC             := 0}
  176.     {$SETC TARGET_RT_MAC_CFM            := 0}
  177.     {$SETC TARGET_RT_MAC_68881            := OPTION(mc68881)}
  178.     {$SETC TARGET_OS_MAC                := 1}
  179.     {$SETC TARGET_OS_WIN32                := 0}
  180.     {$SETC TARGET_OS_UNIX                := 0}
  181.     {$SETC TARGET_RT_LITTLE_ENDIAN        := 0}
  182.     {$SETC TARGET_RT_BIG_ENDIAN            := 1}
  183.     {$SETC TYPE_EXTENDED                := 1}
  184.     {$SETC TYPE_LONGLONG                := 0}
  185.     {$SETC TYPE_BOOL                    := 0}
  186.     {$SETC TYPED_FUNCTION_POINTERS        := 0}
  187. {$ELSEC}
  188.  
  189.  
  190.     {
  191.         MPW Pascal compiler from Apple Computer, Inc.     << WARNING: Unsupported Compiler >>
  192.     }
  193.     {$SETC TARGET_CPU_68K                  := 1}
  194.     {$SETC TARGET_CPU_PPC                  := 0}
  195.     {$SETC TARGET_CPU_X86                  := 0}
  196.     {$SETC TARGET_CPU_MIPS                 := 0}
  197.     {$SETC TARGET_CPU_SPARC             := 0}
  198.     {$SETC TARGET_RT_MAC_CFM            := 0}
  199.     {$SETC TARGET_RT_MAC_68881            := OPTION(mc68881)}
  200.     {$SETC TARGET_OS_MAC                := 1}
  201.     {$SETC TARGET_OS_WIN32                := 0}
  202.     {$SETC TARGET_OS_UNIX                := 0}
  203.     {$SETC TARGET_RT_LITTLE_ENDIAN        := 0}
  204.     {$SETC TARGET_RT_BIG_ENDIAN            := 1}
  205.     {$SETC TYPE_EXTENDED                := 1}
  206.     {$SETC TYPE_LONGLONG                := 0}
  207.     {$SETC TYPE_BOOL                    := 0}
  208.     {$SETC TYPED_FUNCTION_POINTERS        := 0}
  209. {$ENDC}
  210. {$ENDC}
  211.  
  212.  
  213.  
  214.  
  215.  
  216. {***************************************************************************************************
  217.     Backward compatibility for clients expecting 2.x version on ConditionalMacros.h
  218.  
  219.     GENERATINGPOWERPC        - Compiler is generating PowerPC instructions
  220.     GENERATING68K            - Compiler is generating 68k family instructions
  221.     GENERATING68881            - Compiler is generating mc68881 floating point instructions
  222.     GENERATINGCFM            - Code being generated assumes CFM calling conventions
  223.     CFMSYSTEMCALLS            - No A-traps.  Systems calls are made using CFM and UPP's
  224.     PRAGMA_ALIGN_SUPPORTED    - Compiler supports: #pragma options align=mac68k/power/reset
  225.     PRAGMA_IMPORT_SUPPORTED    - Compiler supports: #pragma import on/off/reset
  226.  
  227. ***************************************************************************************************}
  228. {$IFC TARGET_OS_MAC }
  229. {$SETC GENERATINGPOWERPC := TARGET_CPU_PPC }
  230. {$SETC GENERATING68K := TARGET_CPU_68K }
  231. {$SETC GENERATING68881 := TARGET_RT_MAC_68881 }
  232. {$SETC GENERATINGCFM := TARGET_RT_MAC_CFM }
  233. {$SETC CFMSYSTEMCALLS := TARGET_RT_MAC_CFM }
  234. {
  235.     NOTE: The FOR_≈ conditionals were developed to produce integerated
  236.           interface files for System 7 and Copland.  Now that Copland
  237.           is canceled, all FOR_ conditionals have been removed from
  238.           the interface files.  But, just in case you someone got an 
  239.           interface file that uses them, the following sets the FOR_≈
  240.           conditionals to a consistent, usable state.
  241.  
  242.     #define FOR_OPAQUE_SYSTEM_DATA_STRUCTURES        0
  243.     #ifndef FOR_PTR_BASED_AE
  244.         #define FOR_PTR_BASED_AE                    0
  245.     #endif
  246.     #define FOR_SYSTEM7_ONLY                        1
  247.     #define FOR_SYSTEM7_AND_SYSTEM8_DEPRECATED        1
  248.     #define FOR_SYSTEM7_AND_SYSTEM8_COOPERATIVE        1
  249.     #define FOR_SYSTEM7_AND_SYSTEM8_PREEMPTIVE        1
  250.     #define FOR_SYSTEM8_COOPERATIVE                    0
  251.     #define FOR_SYSTEM8_PREEMPTIVE                    0
  252. }
  253. {$ENDC}  {TARGET_OS_MAC}
  254.  
  255.  
  256.  
  257.  
  258. {***************************************************************************************************
  259.  
  260.     OLDROUTINENAMES            - "Old" names for Macintosh system calls are allowed in source code.
  261.                               (e.g. DisposPtr instead of DisposePtr). The names of system routine
  262.                               are now more sensitive to change because CFM binds by name.  In the 
  263.                               past, system routine names were compiled out to just an A-Trap.  
  264.                               Macros have been added that each map an old name to its new name.  
  265.                               This allows old routine names to be used in existing source files,
  266.                               but the macros only work if OLDROUTINENAMES is true.  This support
  267.                               will be removed in the near future.  Thus, all source code should 
  268.                               be changed to use the new names! You can set OLDROUTINENAMES to false
  269.                               to see if your code has any old names left in it.
  270.     
  271.     OLDROUTINELOCATIONS     - "Old" location of Macintosh system calls are used.  For example, c2pstr 
  272.                               has been moved from Strings to TextUtils.  It is conditionalized in
  273.                               Strings with OLDROUTINELOCATIONS and in TextUtils with !OLDROUTINELOCATIONS.
  274.                               This allows developers to upgrade to newer interface files without 
  275.                               having to change the includes in their source code.  But, it allows
  276.                               the slow migration of system calls to more understandable file locations.  
  277.                               OLDROUTINELOCATIONS currently defaults to true, but eventually will 
  278.                               default to false.
  279.  
  280. ***************************************************************************************************}
  281. {$IFC UNDEFINED OLDROUTINENAMES }
  282. {$SETC OLDROUTINENAMES := 0 }
  283. {$ENDC}
  284.  
  285. {$IFC UNDEFINED OLDROUTINELOCATIONS }
  286. {$SETC OLDROUTINELOCATIONS := 0 }
  287. {$ENDC}
  288.  
  289.  
  290.  
  291.  
  292.  
  293.  
  294.  
  295. {$SETC UsingIncludes := ConditionalMacrosIncludes}
  296.  
  297. {$ENDC} {__CONDITIONALMACROS__}
  298.  
  299. {$IFC NOT UsingIncludes}
  300.  END.
  301. {$ENDC}
  302.